import "./assets/main.css";

import { createApp } from "vue";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import { createMemoryHistory, createRouter } from "vue-router";
import DemoView from "./views/demo/DemoView.vue";
import ButtonDemo from "./views/elcomponents/ButtonDemo.vue";
import App from "./App.vue";

//定义路由规则
const routes = [
  { path: "/", component: DemoView },
  { path: "/button-demo", component: ButtonDemo },
  { path: "/demo", component: DemoView },
];
//定义路由器
const router = createRouter({
  history: createMemoryHistory(),
  routes,
});

const app = createApp(App);
app.use(ElementPlus);
app.use(router);
//注册图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }

app.mount("#app");
